package entity;

import java.util.Date;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import javax.persistence.Table;

@Entity
@Table(name="Hebergement")
public class Hebergement implements Prestation {
	private long id;
	private Date dateDebut;
	private Date dateFin;
	private String description;
	private Adresse adresse;
	private double tarif;
	
	public String toString() {
		return "[" 
			+ description 
			+ ", " 
			+ "arrivée le " 
			+ dateDebut 
			+ ", "
			+ "départ le " 
			+ dateFin 
			+ ", " 
			+ tarif 
			+ ", " 
			+ adresse 
			+ "]";
	}

	public Hebergement() {
		super();
	}
	public Hebergement(Adresse adresse, Date dateDebut, Date dateFin,
			String description, double tarif) {
		super();
		this.adresse = adresse;
		this.dateDebut = dateDebut;
		this.dateFin = dateFin;
		this.description = description;
		this.tarif = tarif;
	}
	@Id
	@GeneratedValue(strategy=GenerationType.AUTO)
	public long getId() {
		return id;
	}
	public void setId(long id) {
		this.id = id;
	}
	public Date getDateDebut() {
		return dateDebut;
	}
	public void setDateDebut(Date dateDebut) {
		this.dateDebut = dateDebut;
	}
	public Date getDateFin() {
		return dateFin;
	}
	public void setDateFin(Date dateFin) {
		this.dateFin = dateFin;
	}
	public String getDescription() {
		return description;
	}
	public void setDescription(String description) {
		this.description = description;
	}
	@OneToOne()
	@JoinColumn(name = "adresse")
	public Adresse getAdresse() {
		return adresse;
	}
	public void setAdresse(Adresse adresse) {
		this.adresse = adresse;
	}
	public double getTarif() {
		return tarif;
	}
	public void setTarif(double tarif) {
		this.tarif = tarif;
	}

}
